/* 
 * File:   FireShooterEnemy.cpp
 * Author: paula
 * 
 * Created on 24 de noviembre de 2014, 15:39
 */

#include "FireShooterEnemy.h"

FireShooterEnemy::FireShooterEnemy() {
}

FireShooterEnemy::FireShooterEnemy(ObjFactory *objFactory, int x, int y) : Enemy(objFactory, x, y, 12) {    
    FireGun *weapon = new FireGun(objFactory);
    this->weapon = weapon;
}

FireShooterEnemy::FireShooterEnemy(const FireShooterEnemy& orig) {
}

FireBall * FireShooterEnemy::shootRandom() {
//    cout<<"shoot Fire Enemy "<<endl;
    int randomNumber = rand() % 500;
    int dire;
    if ((randomNumber == 1)) {
//        cout << "shooooooooooooooooooot" << endl;
        if (this->directionRight) {
            dire = 1;
        } else {
            dire = -1;
        }
        FireBall * snowBall = this->weapon->getBullet(this->getPosX(), this->getPosY(), dire); //disparo una bala al mundo             
        return snowBall;
    }
    return NULL;
}

FireShooterEnemy::~FireShooterEnemy() {
}
